package com.lindroy.androidplayer.viewmodels

import androidx.lifecycle.viewModelScope
import androidx.paging.cachedIn
import com.lindroy.androidplayer.logic.network.repository.Repository
import com.lindroy.androidplayer.utils.mapItem

/**
 * @author Lin
 * @date 2022/2/14
 * @function
 */
class CoinRankingViewModel : PageViewModel() {

    val coinRankingList = Repository.coinRankingList.mapItem {
        CoinRankingItemViewModel(
            it.coinCount,
            it.level,
            it.nickname,
            it.rank,
            it.userId,
            it.username
        )
    }.cachedIn(viewModelScope)
}